<div class="table-top">
  <div class="table-operations clearfix ">
    <div class="pull-left">
      <in-acl-source [inGroup]="'detailheaderAction'" [inService]="'fcs'" [inResourceType]="'fcs-trigger'"
          [inActions]="['CreateTrigger']" [inIsLast]="true" #detailheaderAction>
      <in-acl-btn [inActions]="detailheaderAction.resActions" inAction="CreateTrigger" inLabel="创建触发器" > 
      <button nz-button nzType="primary" class="btn-add" (click)="createTrigger()"><i class="fas fa-plus"></i>创建触发器
      </button>
      </in-acl-btn>
      </in-acl-source>
    </div>
    <div class="pull-right">
      <!-- 搜索 -->
      <nz-select nzPlaceHolder="请选择触发器类型" style="width: 200px;"  [(ngModel)]="triggerType" (ngModelChange)="triggerTypeChange()">
        <nz-option *ngFor="let object of triggerTypeList"
                   [nzLabel]="object.label" [nzValue]="object.value">
        </nz-option>
      </nz-select>
      <ng-template #suffixIconButton>
        <button nz-button
                nzSearch
                (click)="refreshTriggerList()">
          <i class="anticon anticon-search"></i>
        </button>
      </ng-template>
      <!-- <nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
        <input type="text" nz-input placeholder="请输入触发器名称" [(ngModel)]="triggerName" (keyup.enter)="refreshTriggerList()">
      </nz-input-group>
      <ng-template #suffixIconButton>
        <button nz-button class="search-btn"
                nzSearch
                (click)="refreshTriggerList()">
          <i class="anticon anticon-search search-icon"></i>
        </button>
      </ng-template> -->

      <nz-input-group nzSearch [nzSuffix]="suffixIconButton" style="width: 2rem;">
        <input type="text" [(ngModel)]="triggerName" nz-input placeholder="请输入触发器名称查询" (keyup.enter)="refreshTriggerList()">
      </nz-input-group>
      <ng-template #suffixIconButton>
        <i nz-icon class="ant-input-clear-icon" nzTheme="fill" nzType="close-circle" *ngIf="triggerName" (click)="triggerName = '';refreshTriggerList()"></i>
        <button nz-button nzSearch (click)="refreshTriggerList()">
          <i class="anticon anticon-search"></i>
        </button>
      </ng-template>

      <button nz-button class="table-top-opt" (click)="refreshReset()" nz-popover [nzContent]="'刷新'"><i
        class="anticon anticon-reload"></i></button>
    </div>
  </div>
</div>
<div class="bottom-padding">
  <app-trigger-table #triggerTable [fcsInstance]="fcsInstance" [groupId]="groupId" [functionId]="functionId" [isDetail]="isDetail" [triggerName]="triggerName" (resetTriggerTypes)="resetTriggerTypeList($event)" [inActions]="detailheaderAction?.resActions"></app-trigger-table>
</div>

